package com.studio49.exmple.controller.web;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.studio49.exmple.common.constant.ForwardConstant;
import com.studio49.exmple.common.util.PubUtils;
import com.studio49.exmple.entity.web.sys.bo.SessionUserBo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IndexController {
	
	@RequestMapping("/index")
	public String index(HttpServletRequest request, Map<String, Object> map) throws Exception{
		SessionUserBo sessionUserBo = PubUtils.getSessionUserBo(request);
		map.put("user", sessionUserBo);
		return ForwardConstant.INDEX_H;
	}
	
	@RequestMapping("/")
	public String indexRoot(Map<String, Object> map){
		map.put("list", "sdf");
		return ForwardConstant.REDIRECT + ForwardConstant.INDEX;
	}
	
	@RequestMapping("/homePage")
	public String homePage(Map<String, Object> map){
		return ForwardConstant.HOME;
	}
	
}
